import { createApp } from 'vue'
import '@/styles/reset.css'
import App from './App.vue'
import pinia from "@/store/pinia";
import router from "@/router";
import ElementPlus from "element-plus";
import zhCn from "element-plus/es/locale/lang/zh-cn"; //element-plus中文
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import {messageBox , messagePrompt} from "@/utils/msgBox"
import GlobalComponents from '@/utils/global_components';
import 'virtual:svg-icons-register'
import "lib-flexible-computer";


// 图标库需要遍历加入app的组件
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.provide('messageBox', messageBox) // 将方法挂载到全局
app.provide('messagePrompt', messagePrompt) // 将方法挂载到全局

app.use(pinia)
.use(GlobalComponents)
.use(router)
.use(ElementPlus, { locale: zhCn })
.mount('#app')
